package com.watercube.dao.config;

import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

/**
 * @Project: water-cube-dao
 * @Description druid 监控访问地址 ip:port/druid/index.html
 * @author yangyh
 * @date 2017年12月4日
 * @version V1.0
 */
@Configuration
public class DruidDataSourceConfiguration implements EnvironmentAware {

	// @Primary
	// @Bean
	// @ConfigurationProperties("spring.datasource")
	// public DataSource druidDataSource() {
	// return DruidDataSourceBuilder.create().build();
	// }

	@Override
	public void setEnvironment(Environment environment) {
		System.err.println("spring.datasource.druid.url___" + environment.getProperty("spring.datasource.druid.url"));
		System.err.println(
				"spring.datasource.druid.username___" + environment.getProperty("spring.datasource.druid.username"));
		System.err.println("spring.datasource.druid.driverClassName___"
				+ environment.getProperty("spring.datasource.druid.driverClassName"));
	}

}